﻿namespace PropOnline.Controllers
{
    using System.Collections.Generic;
    using System.Linq;
    using System.Web.Mvc;
    using PropOnline.Stores;
    
    [Authorize]
    public class MapaController : Controller
    {
        [HttpGet]
        public ActionResult Mostrar(string latitud, string longitud)
        {
            ViewBag.Latitud = latitud;
            ViewBag.Longitud = longitud;

            return PartialView();
        }

        [HttpGet]
        public ActionResult Calles(string term)
        {
            IEnumerable<string> callesFiltered = new BusquedaStore().ObtenerCalles(term).Select(c => c.Nombre);

            return this.Json(
                callesFiltered,
                JsonRequestBehavior.AllowGet);
        }
    }
}
